# Contributor: Celeste <cielesti@protonmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=emacs-s
pkgver=1.13.0_git20230414
_gitrev=dda84d38fffdaf0c9b12837b504b402af910d01d
pkgrel=0
_pkgreal=s
pkgdesc="Emacs string manipulation library"
url="https://github.com/magnars/s.el"
arch="noarch"
license="GPL-3.0-or-later"
depends="cmd:emacs"
makedepends="emacs-nox"
source="https://github.com/magnars/s.el/archive/$_gitrev/emacs-s-$_gitrev.tar.gz"
builddir="$srcdir/s.el-$_gitrev"

build() {
	emacs -batch -q -no-site-file -L . \
		-eval '(setq byte-compile-error-on-warn t)' \
		-f batch-byte-compile \
		./*.el
}

check() {
	emacs -batch -q -no-site-file -L . -L dev \
		-l examples-to-tests -l examples \
		-f ert-run-tests-batch-and-exit
}

package() {
	install -Dvm644 ./*.el ./*.elc \
		-t "$pkgdir"/usr/share/emacs/site-lisp/

	cd "$pkgdir"/usr/share/emacs/site-lisp
	emacs -batch -q -no-site-file \
		-eval "(loaddefs-generate \".\" \"$_pkgreal-loaddefs.el\")"
}

sha512sums="
07886d28975d6d96610d23eadb1be4fa1a1aba4c7f5414acc7ef77ba567dbee196373b83af4b22ec2377f39973d7c021f75096712bc3915b63cb99b7b79ef806  emacs-s-dda84d38fffdaf0c9b12837b504b402af910d01d.tar.gz
"
